<template>
  <div>
    <hr>
    <p>---这是一个子组件v-model--------{{ aa }}<br>{{ cc }}</p>
    <button @click="add">加1</button>
  </div>
</template>

<script>
export default {
  props: {
    aa: {
      type: Number,
      required: true
    },
    cc: {
      type: Number,
      required: true
    }
  },
  data() {
    return {
    }
  },

  mounted() {
  },

  methods: {
    add() {
    // this.value++
    // this.value=this.value+1
    // 可以通过子传父来进行修改
      this.$emit('update:aa', this.aa + 1)
      this.$emit('update:cc', this.cc + 1)
    }
  }
}
</script>

<style lang="scss" scoped></style>
